<%--
  Created by IntelliJ IDEA.
  User: hxh
  Date: 16/4/23
  Time: 下午2:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>添加新闻</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <link href="/static/bui/css/bs3/dpl.css" rel="stylesheet" type="text/css"/>
  <link href="/static/bui/css/bs3/bui.css" rel="stylesheet" type="text/css"/>
  <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.config.js"></script>
  <script type="text/javascript" charset="utf-8" src="/ueditor/ueditor.all.js"></script>
  <script type="text/javascript" src="/static/bui/js/jquery-1.8.1.min.js"></script>
</head>
<body>
<div class="content" style="margin: 15px">

  <form id="J_Form" class="form-horizontal" style="outline: none;width: 1100px" action="/guide/edit"
        method="post">

    <input type="hidden" name="id" value="${guide._id}">

      <div class="row">
        <div class="control-group span8">
          <label class="control-label"><s>*</s>类型：</label>

          <div class="controls control-row2">
            <select name="type">
              <option value="1" <c:if test="${guide.type==1}"> selected</c:if> >参会地址</option>
              <option value="2" <c:if test="${guide.type==2}"> selected</c:if> >酒店交通</option>
            </select>
          </div>
        </div>
        <div class="control-group span8">
          <label class="control-label"><s>*</s>是否可用：</label>

          <div class="controls control-row2">
            <select name="status">
              <option value="1" <c:if test="${guide.status==1}"> selected</c:if> >是</option>
              <option value="2" <c:if test="${guide.status==2}"> selected</c:if> >否</option>
            </select>
          </div>
        </div>
        <div class="control-group span4" style="float: right;margin-bottom: 20px">
          <button id="btnSearch" type="submit" class="button button-primary" style="margin-top: 20px">提交</button>
        </div>
      </div>



    <div class="row" style="margin: 0 auto">
      <div id="valueContent" style="display: none">${guide.content}</div>
      <div class="control-group span12">
        <!-- 加载编辑器的容器 -->
        <div>
          <script id="container" name="content" type="text/plain" style="width:1024px;height:500px;">
          </script>
        </div>
      </div>

    </div>
  </form>
</div>
<script type="text/javascript">

  // 定义UEditor对应的主目录
  window.UEDITOR_HOME_URL = "${contextPath}/ueditor/";
  // 页面加载完成后载入UEditor
  window.onload = function () {
    window.UEDITOR_CONFIG.initialFrameWidth = 850;
    window.UEDITOR_CONFIG.initialFrameHeight = 600;
    var editor = UE.getEditor('container');

    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function (action) {
      if (action == "uploadimage") {
        return "/uploadImage.json";
      } else if (action == "uploadvideo") {
        return "/uploadVideo.json"
      }
      else {
        return this._bkGetActionUrl.call(this, action);
      }
    }

    var content = $('#valueContent').html()
//        console.log(content)
    $(function () {
      //判断ueditor 编辑器是否创建成功
      editor.addListener("ready", function () {
        // editor准备好之后才可以使用
        editor.setContent(content);
      });
    });
  }
</script>
</body>
</html>

